// import { isArray } from '@/utils'

const sharebox = {
  state: {
    boxwidth: {width: '0px'},
    boxtitle: '测试标题',
    boxdesc: '测试内容测试内容测试内容测试内容测试内容测试内容测试内容测试内容测试内容测试内容',
    boxtime: '2018年12月12日 23:59:59',
    boximg: '',
    boxtips: '最新资讯',
    overlay: false
  },
  mutations: {
    SET_SHARE_BOX_WIDTH: (state, arg) => {
      state.boxwidth = arg
    },
    SET_SHARE_BOX_TITLE: (state, arg) => {
      state.boxtitle = arg
    },
    SET_SHARE_BOX_DESC: (state, arg) => {
      state.boxdesc = arg
    },
    SET_SHARE_BOX_TIME: (state, arg) => {
      state.boxtime = arg
    },
    SET_SHARE_BOX_IMG: (state, arg) => {
      state.boximg = arg
    },
    SET_OVERLAY: (state) => {
      state.overlay = !state.overlay
    }
  },
  actions: {
    SetShareBoxWidth ({ commit }, arg) {
      commit('SET_SHARE_BOX_WIDTH', arg)
    },
    SetShareBoxTitle ({ commit }, arg) {
      commit('SET_SHARE_BOX_TITLE', arg)
    },
    SetShareBoxDesc ({ commit }, arg) {
      commit('SET_SHARE_BOX_DESC', arg)
    },
    SetShareBoxTime ({ commit }, arg) {
      commit('SET_SHARE_BOX_TIME', arg)
    },
    SetShareBoxImg ({ commit }, arg) {
      commit('SET_SHARE_BOX_IMG', arg)
    },
    ToggleOverlay ({ commit }) {
      commit('SET_OVERLAY')
    }
  }
}

export default sharebox
